var linkPage = GetString('type');
linkPage = linkPage ? linkPage : 'information';
var menu = document.getElementById('menu');
var allLinks = menu.querySelectorAll('a');


for ( var i = 0; i < allLinks.length; i++ ) {
  var linkDataset = allLinks[i].dataset.dyw;
  if ( linkDataset === linkPage ) {
    allLinks[i].className = 'menu-active';
    var linkName = allLinks[i].parentNode.className;
    if ( linkName && linkName === 'list-show' ) {
      allLinks[i].parentNode.style.display = 'block';
    }
  }
}


//获取链接参数
function GetString(name) {
  var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
  var r = window.location.search.substr(1).match(reg);
  if (r != null) {
    return r[2];
  }
  return null;
}